<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018-4-24
  Time: 15:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>


<%

    //    int a = 10;

    pageContext.setAttribute("a", 10);

    request.setAttribute("b", 20);

    session.setAttribute("c", 30);

    application.setAttribute("d", 40);

//    out.write(String.valueOf(pageContext.getAttribute("a")));

    String name = "gschen";


    class User {
        //         int id;
        public String name;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    User chen = new User();
//    chen.id = 1001;
//    chen.name = "chen";
    chen.setName("chen");

    session.setAttribute("chen", chen);

%>

<%--<h1>${pageScope.chen.id}</h1>--%>
<h1>${chen.name}</h1>

<h1>${ 5+2}</h1>

<h1>${a}</h1>
<%--<h1>${b}</h1>--%>
<%--<h1>${c}</h1>--%>
<%--<h1>${d}</h1>--%>

<%--<h1> ${pageScope.a} </h1>--%>

<%--<h1>${requestScope.b}</h1>--%>

<%--<h1>${sessionScope.c}</h1>--%>

<%--<h1>${applicationScope.d}</h1>--%>


</body>
</html>
